<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>文章列表</title>
  <link rel="stylesheet" type="text/css" href="../assets/lib/layui/css/layui.css">
  <script type="text/html" id="cate-tpl">
    <option value="">请选择分类...</option>
    {{each data}}
      <option value="{{$value.Id}}">{{$value.name}}</option>
    {{/each}}
  </script>
  <script type="text/html" id="list-tpl">
    {{each data}}
      <tr>
        <td>{{$value.title}}</td>
        <td>{{$value.cate_name}}</td>
        <td>{{$value.pub_date | formatDate}}</td>
        <td>{{$value.state}}</td>
        <td>
          <button data-id='{{$value.Id}}' type="button" class="layui-btn layui-btn-xs edit-cate">编辑</button>
          <button data-id='{{$value.Id}}' type="button" class="layui-btn layui-btn-danger layui-btn-xs">删除</button>
        </td>
      </tr>
    {{/each}}
  </script>
</head>
<body>
  <div class="layui-card">
    <div class="layui-card-header">文章列表</div>
    <div class="layui-card-body">
      <!--筛选下拉选项-->
      <form id="search-form" class="layui-form">
        <div class="layui-form-item">
          <div class="layui-inline">
            <div class="layui-input-inline" style="width: 100px;">
              <select name="cate_id" id="category" lay-verify="">
                <!-- 这里放分类 -->
              </select>
            </div>
            <div class="layui-input-inline" style="width: 100px;">
              <select name="state" lay-verify="">
                <option value="">所有状态</option>
                <option value="已发布">已发布</option>
                <option value="草稿">草稿</option>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <div class="layui-input-inline" style="width: 100px;">
              <button id="query-btn" class="layui-btn" lay-submit lay-filter="formDemo">筛选</button>
            </div>
          </div>
        </div>
      </form>
      <!--表格区域-->
      <table class="layui-table">
        <colgroup>
          <col width="40%">
          <col width="15%">
          <col width="15%">
          <col width="15%">
          <col>
        </colgroup>
        <thead>
          <tr>
            <th>文章标题</th>
            <th>分类</th>
            <th>发表时间</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
            <!-- 这里放数据 -->
        </tbody>
      </table>
      <!-- 列表分页 -->
      <div id="page"></div>
    </div>
  </div>
    
  <script type="text/javascript" src="../assets/lib/jquery.js"></script>
  <script type="text/javascript" src="../assets/js/common.js"></script>
  <script type="text/javascript" src="../assets/lib/layui/layui.all.js"></script>
  <script type="text/javascript" src="../assets/lib/template-web.js"></script>
  <script type="text/javascript" src="../assets/js/article/list.js"></script>
</body>
</html>